package com.cdshangpai.utils.storage;

import java.util.concurrent.BlockingQueue;

public class DownloadListenter implements OnDownloadListener{

    private final BlockingQueue<String> queue;

    public DownloadListenter(BlockingQueue<String> queue)
    {
        this.queue=queue;
    }

    @Override
    public void onDownloadSuccess(String fileName) {
        try {
            queue.put(fileName);
        }catch (InterruptedException e)
        {}

    }

    @Override
    public void onDownloading(int progress) {

    }

    @Override
    public void onDownloadFailed() {
        try {
            queue.put("");
        }catch (InterruptedException e)
        {}
    }
}
